<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<title>JPQL Query Editor</title>
<link rel="stylesheet" href="ide.css" title="Oracle BLAFDoc" type="text/css"/>
</head>

<body>
<p><a id="text.x-jpql" name="text.x-jpql"></a></p>
<div id="NBCSH5030"><!-- infolevel="all" infotype="General" --><a id="sthref745" name="sthref745"></a>
<h1>JPQL Query Editor</h1>
<a name="BEGIN" id="BEGIN"></a>
<p>Use to write and execute JPQL queries within the IDE and view the results of the query. The query editor supports code completion for JPQL keywords and for managed entities in your application.</p>
<p>You open the JPQL Query Editor by right-clicking the <code dir="ltr">persistence.xml</code> file in the Projects window or Files window and then choosing <b>Run JPQL Query</b> in the popup menu. The Persistence Unit drop-down list in the toolbar of the JPQL Query Editor contains the persistence units that are specified in <code dir="ltr">persistence.xml</code>. To run a query, type the query in the text area of the query editor, select a persistence unit in the drop-down list and click the <b>Run JPQL Query</b> button in the toolbar ( Run JPQL ). 
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<param name="content" value="http://www.oracle.com/pls/topic/lookup?ctx=nb8200&id=NBDAG2767">
<param name="text" value="<html><u>More</u></html>">
<param name="textFontSize" value="medium">
<param name="textColor" value="blue">
</object>
</p>
<p>When you run a JPQL query, the query is run against the database that is specified in the persistence unit that is selected in the drop-down list. The results of the query appear in the Result pane in the lower half of the JPQL Query Editor.</p>
<p><b>Note:</b> You need to build the project before you can run the JPQL query.</p>
<p>The drivers for the database that is specified in the persistence unit must be on the project classpath.</p>
<p>If you are using EclipseLink as the persistence provider you can click the SQL tab to view the SQL query that corresponds to the JPQL query.</p>
<a id="NBCSH5031" name="NBCSH5031"></a>
<hr><p><b>Related Topics</b></p>
<p><i>Developing Applications with NetBeans IDE</i>, 
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<param name="content" value="http://www.oracle.com/pls/topic/lookup?ctx=nb8200&id=NBDAG2764">
<param name="text" value="<html><u>&quot;About Developing with Java Persistence&quot;</u></html>">
<param name="textFontSize" value="medium">
<param name="textColor" value="blue">
</object>
</p>

<!-- -->
<!-- Start Footer -->


<table summary="" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" width="86%"><a href="legal_notice.htm">
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0.</a>
</td>
</tr>
</table>
<!-- -->
</body>
</html>
